package com.ifnoelse.scheduler;

import java.util.concurrent.Callable;

/**
 * Created by ifnoelse on 2016/1/10.
 */
public class RunnableCallable implements Runnable, Callable {
    Runnable runnable;
    Callable callable;

    public RunnableCallable(Runnable runnable) {
        this.runnable = runnable;
    }

    public RunnableCallable(Callable callable) {
        this.callable = callable;
    }

    @Override
    public Object call() throws Exception {
        return callable.call();
    }

    @Override
    public void run() {
        runnable.run();
    }
}
